import { createBrowserRouter, RouteObject } from "react-router-dom";
/**
 * TODO: 路由配置
 */
import Layout from "../layout";
// 首页


// 404页面
import NotFoundPage from "../components/404";
import Landing from "../pages/Landing";
import Login from "../pages/Login";
import Register from "../pages/Register";
import Forget from "../pages/Forget";
import AddGood from "../pages/AddGood";
import Manage from "../pages/Manage";
import Market from "../pages/Market";
import Particulars from "../pages/Particulars"
const routes: RouteObject[] = [
  {
    path: "/list",
    element: <Layout />,
    children: [
      {
        path: "manage",
        element: <Manage />,
      },
      {
        path: "market",
        element: <Market />,
      },
      {
        path: "addgood",
        element: <AddGood />,
      },
      {
        path: 'part/:Id',
        element: <Particulars />
      }
    ],
  },
  

  {
    path: "*",
    element: <NotFoundPage />,
  },
  {
    path: "/landing",
    element: <Landing />,
  },
  {
    path: "/login",
    element: <Login />,
  },
  {
    path: "/register",
    element: <Register />,
  },
  {
    path: "/forget",
    element: <Forget />,
  },
  {
    path: "/",
    element: <Landing />,
  },


];

const router = createBrowserRouter(routes);

export default router;
